package com.qf.shiro;

import com.qf.mapper.DtsGoodsProductMapper;
import com.qf.pojo.DtsGoodsProduct;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author 邢式瑞
 * @version 1.0
 * @project E-commercebackGroundManagementSystem
 * @date 2022/9/24 19:31
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring/spring-mybatis-plus.xml")
public class test {
    @Autowired
    DtsGoodsProductMapper mapper;
    @Test
    public void test(){
        DtsGoodsProduct dtsGoodsProduct1=new DtsGoodsProduct();
        DtsGoodsProduct dtsGoodsProduct2=new DtsGoodsProduct();
        DtsGoodsProduct dtsGoodsProduct3=new DtsGoodsProduct();
        DtsGoodsProduct dtsGoodsProduct4=new DtsGoodsProduct();
        DtsGoodsProduct dtsGoodsProduct5=new DtsGoodsProduct();

        dtsGoodsProduct4.setId(283206); dtsGoodsProduct5.setId(283207);
        dtsGoodsProduct1.setGoodsId(19315);
        dtsGoodsProduct2.setGoodsId(1000002);
        dtsGoodsProduct3.setGoodsId(1000003);


        dtsGoodsProduct1.setSpecifications(new String[]{"jjj"});
        dtsGoodsProduct2.setSpecifications(new String[]{"jjj"});
        dtsGoodsProduct3.setSpecifications(new String[]{"jjj"});
        dtsGoodsProduct1.setAddTime(new Date());
        dtsGoodsProduct2.setAddTime(new Date());
        dtsGoodsProduct3.setAddTime(new Date());
        ArrayList<DtsGoodsProduct>list=new ArrayList<>();

        list.add(dtsGoodsProduct4);
        list.add(dtsGoodsProduct5);

//        mapper.insertList(list);
        mapper.updateList(list);
    }
}
